package com.feng.vhr.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.feng.vhr.common.RespBean;
import com.feng.vhr.pojo.Hr;
import com.feng.vhr.response.RHr;
import com.feng.vhr.service.IHrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/chat")
public class ChatController {
    @Autowired
    IHrService hrService;
    @GetMapping("/hrs")
    public RespBean getAllHrs() {
        RHr rHr = (RHr) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        QueryWrapper<Hr> wrapper = new QueryWrapper<>();
        wrapper.ne("id",rHr.getId());
        List<Hr> list = hrService.list(wrapper);
        return RespBean.ok("",list);
    }
}
